package co.com.inventarios.modelo;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Mngclase entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "MNGCLASE", schema = "MANAGER", uniqueConstraints = {})
public class Mngclase implements java.io.Serializable {

	// Fields

	private String clacodigo;
	private String clanombre;
	private Long claactivo;
	private Timestamp clalogfec;
	private Dlluser dlluser;
	private Set<Mngtdc> mngtdcs = new HashSet<Mngtdc>(0);

	// Constructors

	/** default constructor */
	public Mngclase() {
	}

	/** minimal constructor */
	public Mngclase(String clacodigo) {
		this.clacodigo = clacodigo;
	}

	/** full constructor */
	public Mngclase(String clacodigo, String clanombre, Long claactivo,Dlluser dlluser,Timestamp clalogfec,
			Set<Mngtdc> mngtdcs) {
		this.clacodigo = clacodigo;
		this.dlluser = dlluser;
		this.clanombre = clanombre;
		this.clalogfec = clalogfec;
		this.claactivo = claactivo;
		this.mngtdcs = mngtdcs;
	}

	// Property accessors
	@Id
	@Column(name = "CLACODIGO", unique = true, nullable = false, insertable = true, updatable = true, length = 4)
	public String getClacodigo() {
		return this.clacodigo;
	}

	public void setClacodigo(String clacodigo) {
		this.clacodigo = clacodigo;
	}

	@Column(name = "CLANOMBRE", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public String getClanombre() {
		return this.clanombre;
	}

	public void setClanombre(String clanombre) {
		this.clanombre = clanombre;
	}

	@Column(name = "CLAACTIVO", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getClaactivo() {
		return this.claactivo;
	}

	
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "CLALOGUSER", unique = false, nullable = true, insertable = true, updatable = true)
	public Dlluser getDlluser() {
		return this.dlluser;
	}

	public void setDlluser(Dlluser dlluser) {
		this.dlluser = dlluser;
	}

	@Column(name = "CLALOGFEC", unique = false, nullable = true, insertable = true, updatable = true)
	public Timestamp getClalogfec() {
		return this.clalogfec;
	}

	public void setClalogfec(Timestamp clalogfec) {
		this.clalogfec = clalogfec;
	}
	
	public void setClaactivo(Long claactivo) {
		this.claactivo = claactivo;
	}

	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "mngclase")
	public Set<Mngtdc> getMngtdcs() {
		return this.mngtdcs;
	}

	public void setMngtdcs(Set<Mngtdc> mngtdcs) {
		this.mngtdcs = mngtdcs;
	}

}